package com.example.port.controller;

import org.apache.catalina.User;
import org.springframework.web.bind.annotation.*;

@RestController
public class userController {
    @GetMapping("/user/{id}")
    public String getuser(@PathVariable int id){
        System.out.println(id);
        return("根据id获取用户信息");
    }

    @PostMapping("/user")
    public String save (User user){
        return"添加用户";
    }
    @PutMapping("/user")
    public String update(User user){
        return "更新用户";
    }
    @DeleteMapping("/user/{id}")
    public String deleteuser(@PathVariable int id){
        System.out.println(id);
        return"根据id删除用户";
    }
}
